package me.tuyou.activiti.processEngine;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.junit.Assert;
import org.junit.Test;

public class DefaultProcessEngine {

    @Test
    public void getDefaultProcessEngine() {
        ProcessEngine defaultProcessEngine = ProcessEngines.getDefaultProcessEngine();
        Assert.assertNotNull(defaultProcessEngine);

        RepositoryService repositoryService = defaultProcessEngine.getRepositoryService();
        Assert.assertNotNull(repositoryService);

        for (Deployment deployment : repositoryService.createDeploymentQuery().list()) {
            System.out.println(ReflectionToStringBuilder.toString(deployment));
        }
    }
}
